<template>
	<el-dialog :visible.sync="addVisible" @close="$emit('update:addVisible',false)" width="70%" :show-close='false' class="standarLineDialog"
	 :closeOnClickModal='false'>
		<span slot="title" class="dialog-title">
		  	查看标准曲线
			<el-button  size="mini" @click="close" class="popupClose">关闭</el-button>
		</span>
		<el-table :data="standardSeries.seriesRow" style="width: 100%" size="mini" border>
				<el-table-column label="标准系列序号" width="110px" property="title" fixed>
				</el-table-column>
				
				<el-table-column v-for="col in standardSeries.series" :key="col.id" :label="col.seriesSort">
					<template slot-scope="scope">
							<!--<el-input-number size="mini" :min="0" class="controlsPosition borderNone"></el-input-number>-->
					</template>
				</el-table-column>

			</el-table>

	</el-dialog>
</template>

<script>
	import $ from 'jquery'
	import { mapState } from 'vuex'


	export default {
		data() {
			return {
				standardSeries:{},

			}
		},
		watch: {
			addVisible(val) {
				if (val) {
					this.getCriterion();

				}

			}
		},
		props: ['addVisible', 'testpanelData'],
		components: {

		},
		mounted() {

		},
		computed: {
			...mapState(['tableHeightA']),
		},
		methods: {
			getCriterion() {
				var data = {
					equipment: this.testpanelData.equipment,
					curve:this.testpanelData.curve
				};
				this.$http({
					method: 'post',
					apiUrl: '/detection/criterionMap.htm',
					params: data,
					isJson: false,
				}).then(res => {
					if (res.code === 0) {
						this.standardSeries = res.data;
						this.standardSeries.seriesRow = [];
						for (var k = 0; k < 2; k++) {//渲染标准系列表的第一列
							var childObj = {};
							if(k == 0){
								childObj.title = '标准系列浓度';
							}else if(k == 1){
								childObj.title = '标准系列信号值';
							}
							this.standardSeries.seriesRow.push(childObj)
						}
						console.log(this.standardSeries)

					}

				})
			},
			close() {
				this.$emit('update:addVisible', false)
			}
		}
	}

</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
	.standarLineDialog .el-dialog {

		height: 70%;
	}
	/*.standarLineDialog .el-dialog .el-dialog__body {
		height: calc(100% - 85px);
		padding: 10px;
	}*/
</style>